package com.thh.shirodemo.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create 2022-07-17-23:53
 */
@RestController
@RequestMapping("/salary")
public class SalaryController {
    @RequiresPermissions("salary")
    @RequestMapping("/query")
    public String query(){
//        也可以在ShiroConfig中配置

//        Subject currentUser = SecurityUtils.getSubject();
//        if(currentUser.isPermitted("salary")){
//            return "salary";
//        }
//        return "error";
        return "salary";
    }
}
